$(function(){
    //$(".message").fadeOut(5000);

    $("#logout,#logout2").click(function () {
       $("#logoutForm").submit();
    });
/*
    $("#clearCookie").click(function () {
        $.removeCookie("no" ,{ path: '/' });
        $.removeCookie("name" ,{ path: '/' });
        $.removeCookie("page" ,{ path: '/' });
        $.removeCookie("pageSize" ,{ path: '/' });
    });
*/
    var collapseListGroup = $.cookie("inputCheck");
    if (collapseListGroup !== null) {
        $("#" + collapseListGroup).prop("checked",true);
    }
    //每个有子菜单的菜单项添加点击事件
    $(".tree label").click(function () {
        //获取当前菜单旁边input的check状态
        var inputCheck = $(this).next("input[type='checkbox']");
        var isChecked = inputCheck.is(':checked');
        //展开和收齐的不同状态下更换右侧小图标
        if (isChecked) {
            $.removeCookie("inputCheck",{path: '/'});
            /*
            $(this).css(
                "background-image", "url(../images/cp-detail-arrow-b.png)"
            );
            */
        } else {
            $.cookie("inputCheck", inputCheck.prop("id"), { path: '/'});
            /*
            $(this).css(
                "background-image", "url(../images/cp-detail-arrow-t.png)"
            );
            */
        }
    });

});